# server_data.py
import pandas as pd

def load_server_data(path="servers.xlsx"):
    df = pd.read_excel(path)
    return df.to_dict(orient="records")  # 返回列表形式，每行为一个字典

def search_server(field: str, value: str):
    data = load_server_data()
    result = [entry for entry in data if str(entry.get(field, "")).lower() == value.lower()]
    return result
